package com.itqf.xiaomi.service.impl;

import com.itqf.xiaomi.mapper.ResourceMapper;
import com.itqf.xiaomi.pojo.Carousel;
import com.itqf.xiaomi.service.ResouceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * projectName: springboot_part
 *
 * @author: 赵伟风
 * time: 2021/9/26 16:46
 * description:
 */
@Service
public class ResourceServiceImpl implements ResouceService {

    @Autowired
    private ResourceMapper resourceMapper;
    /**
     * 查询所有轮播图数据
     *
     * @return
     */
    @Override
    public Object findAll() {

        List<Carousel> carousels = resourceMapper.selectList(null);

        Map data = new HashMap();
        data.put("code", "001");
        data.put("carousel",carousels);

        return data;
    }
}
